package com.mall.concurrency.example.singleton;

/**
 * @Author:zwy
 * @Despriction:
 * @Date:Create in 15:00 2018/5/29
 * @Modify By:
 */
public class SingletonExamle6 {
    private SingletonExamle6(){

    }
    static {
        instance = new SingletonExamle6();
    }
    //1f
    private volatile static SingletonExamle6 instance = null;

    public  static SingletonExamle6 getInstance(){

        return instance;
    }

    public static void main(String[] args) {
        System.out.println(getInstance());
        System.out.println(getInstance());
    }
}
